package com.ctbri.io;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

public class Ex8 {

	public static void main(String[] args) throws IOException {
		if(args.length == 0)
			return;
		BufferedReader in = new BufferedReader(new FileReader(args[0]));
		List<String> lines = new LinkedList<>();
		String s;
		while((s = in.readLine()) != null) {
			lines.add(s);
		}
		in.close();
		Collections.reverse(lines);
		System.out.println(lines);
	}

}
